/****************************************************************************
 *                                                                          *
 *    All codes are property of Genesis Securities, LLC.                    *
 *    Any use without prior written permission is illegal.                  *
 *    This material cannot be distributed without prior written permission. *
 *                                                                          *
 ****************************************************************************/
/*! \file TraderErrMsg.h
	\brief Defines Trader Error Messages
 */

#ifndef __TRADERERRMSG_H__
#define __TRADERERRMSG_H__

#include "GTConst.h"

#define TRADER_RCD_ERROR_INVALID_USERID			(TRADER_RCD_ERROR_0 + 1)
#define TRADER_RCD_ERROR_INVALID_USERACCOUNT	(TRADER_RCD_ERROR_0 + 2)
#define TRADER_RCD_ERROR_ACCOUNT_NOT_ACCESS		(TRADER_RCD_ERROR_0 + 3)
#define TRADER_RCD_ERROR_INVALID_PASSWORD		(TRADER_RCD_ERROR_0 + 4)
#define TRADER_RCD_ERROR_INVALID_APPID			(TRADER_RCD_ERROR_0 + 5)
#define TRADER_RCD_ERROR_INVALID_APPVER			(TRADER_RCD_ERROR_0 + 6)

#define TRADER_RCD_ERROR_INVALID_MACHINE		(TRADER_RCD_ERROR_0 + 11)
#define TRADER_RCD_ERROR_INVALID_IPADDRESS		(TRADER_RCD_ERROR_0 + 12)
#define TRADER_RCD_ERROR_INVALID_DATE			(TRADER_RCD_ERROR_0 + 13)
#define TRADER_RCD_ERROR_INVALID_TIME			(TRADER_RCD_ERROR_0 + 14)
#define TRADER_RCD_ERROR_INVALID_TICKETNO		(TRADER_RCD_ERROR_0 + 15)
#define TRADER_RCD_ERROR_INVALID_EXCHANGE		(TRADER_RCD_ERROR_0 + 16)
#define TRADER_RCD_ERROR_INVALID_PENDING_ORDER	(TRADER_RCD_ERROR_0 + 17)
#define TRADER_RCD_ERROR_NOSOES					(TRADER_RCD_ERROR_0 + 18)

#define TRADER_RCD_ERROR_PENDING_BUY			(TRADER_RCD_ERROR_0 + 21)
#define TRADER_RCD_ERROR_PENDING_SELL			(TRADER_RCD_ERROR_0 + 22)
#define TRADER_RCD_ERROR_PENDING_SHORT			(TRADER_RCD_ERROR_0 + 23)
#define TRADER_RCD_ERROR_PENDING_BUY_SHORT		(TRADER_RCD_ERROR_0 + 24)

#define TRADER_RCD_ERROR_OPEN_LOW_SELL			(TRADER_RCD_ERROR_0 + 31)
#define TRADER_RCD_ERROR_OPEN_NOTHING_SELL		(TRADER_RCD_ERROR_0 + 32)
#define TRADER_RCD_ERROR_OPEN_BUY_SHORT			(TRADER_RCD_ERROR_0 + 33)

#define TRADER_RCD_ERROR_MAXSHARESPERTICKET		(TRADER_RCD_ERROR_0 + 41)
#define TRADER_RCD_ERROR_MAXTICKETSPERDAY		(TRADER_RCD_ERROR_0 + 42)
#define TRADER_RCD_ERROR_MAXSHARESPERDAY		(TRADER_RCD_ERROR_0 + 43)
#define TRADER_RCD_ERROR_BAD_PRICE				(TRADER_RCD_ERROR_0 + 44)
#define TRADER_RCD_ERROR_MAXAMOUNTPERTICKET		(TRADER_RCD_ERROR_0 + 45)
#define TRADER_RCD_ERROR_MAXAMOUNTPERDAY		(TRADER_RCD_ERROR_0 + 46)
#define TRADER_RCD_ERROR_NO_BUYING_POWER		(TRADER_RCD_ERROR_0 + 47)
#define TRADER_RCD_ERROR_MAX_SHARES_PER_POS		(TRADER_RCD_ERROR_0 + 48)
#define TRADER_RCD_ERROR_MAX_LOSS_PER_DAY		(TRADER_RCD_ERROR_0 + 49)
#define TRADER_RCD_ERROR_MAX_SYMBOLS			(TRADER_RCD_ERROR_0 + 50)

#define TRADER_RCD_LOGOUT_INVALID_USERID		(TRADER_RCD_ERROR_0 + 51)
#define TRADER_RCD_LOGOUT_USERID_NOT_FOUND		(TRADER_RCD_ERROR_0 + 52)
#define TRADER_RCD_LOGOUT_NO_ACCOUNT			(TRADER_RCD_ERROR_0 + 53)
#define TRADER_RCD_LOGOUT_WRONG_PASSWORD		(TRADER_RCD_ERROR_0 + 54)
#define TRADER_RCD_LOGOUT_INVALID_MACHINE		(TRADER_RCD_ERROR_0 + 55)
#define TRADER_RCD_LOGOUT_INVALID_IPADDRESS		(TRADER_RCD_ERROR_0 + 56)
#define TRADER_RCD_LOGOUT_USER_ACTIVE			(TRADER_RCD_ERROR_0 + 57)
#define TRADER_RCD_LOGOUT_USER_BLOCKED			(TRADER_RCD_ERROR_0 + 58)
#define TRADER_RCD_LOGOUT_USER_EXPIRE_COUNT		(TRADER_RCD_ERROR_0 + 59)
#define TRADER_RCD_LOGOUT_USER_EXPIRE_DATE		(TRADER_RCD_ERROR_0 + 60)
#define TRADER_RCD_LOGOUT_USER_ADMIN			(TRADER_RCD_ERROR_0 + 61)
#define TRADER_RCD_LOGOUT_NO_ENT				(TRADER_RCD_ERROR_0 + 62)
#define TRADER_RCD_ERR_MAX_OPEN_POS_PER_DAY		(TRADER_RCD_ERROR_0 + 63)
#define TRADER_RCD_ERROR_NO_NEW_POSITIONS		(TRADER_RCD_ERROR_0 + 64)
#define TRADER_RCD_ERROR_EXCEED_ORDER_LIMIT		(TRADER_RCD_ERROR_0 + 65)
#define TRADER_RCD_ERROR_BLOCKED_SYMBOL			(TRADER_RCD_ERROR_0 + 66)
#define TRADER_RCD_LOGOUT_INVALID_AUTH			(TRADER_RCD_ERROR_0 + 67)
#define TRADER_RCD_ERROR_BLOCKED_SYMBOL_ACCOUNTID	(TRADER_RCD_ERROR_0 + 68)

#define TRADER_RCD_LOGOUT_BY_ADMIN				(TRADER_RCD_ERROR_0 + 71)
#define TRADER_RCD_LOGOUT_UNKNOWN_ERROR			(TRADER_RCD_ERROR_0 + 72)
#define TRADER_RCD_LOGOUT_BY_YOURSELF			(TRADER_RCD_ERROR_0 + 73)

#define TRADER_RCD_ERROR_TESTMODE				(TRADER_RCD_ERROR_0 + 81)
#define TRADER_RCD_ERROR_TRAININGMODE			(TRADER_RCD_ERROR_0 + 82)
#define TRADER_RCD_ERROR_PAUSEMODE				(TRADER_RCD_ERROR_0 + 83)

#define TRADER_RCD_ERROR_SHORTSELL_VOILATION	(TRADER_RCD_ERROR_0 + 91)
#define TRADER_RCD_ERROR_NO_SIZE_IN_PRE_MARKET	(TRADER_RCD_ERROR_0 + 92)
#define TRADER_RCD_ERROR_NO_QUOTE				(TRADER_RCD_ERROR_0 + 93)
#define TRADER_RCD_ERROR_NITE_NOT_ALLOWED		(TRADER_RCD_ERROR_0 + 94)
#define TRADER_RCD_ERROR_SHORTSELL_CASH			(TRADER_RCD_ERROR_0 + 95)
#define TRADER_RCD_ERROR_SHORTSELL_VOILATION_SEC	(TRADER_RCD_ERROR_0 + 96)
#define TRADER_RCD_ERROR_NO_LONG_POSITION		(TRADER_RCD_ERROR_0 + 97)

#define TRADER_RCD_ERROR_INVALID_LAYOUT_NO		(TRADER_RCD_ERROR_0 + 101)
#define TRADER_RCD_ERROR_INVALID_LAYOUT_LENGTH	(TRADER_RCD_ERROR_0 + 102)
#define TRADER_RCD_ERROR_SAVE_LAYOUT			(TRADER_RCD_ERROR_0 + 103)
#define TRADER_RCD_ERROR_OPEN_LAYOUT			(TRADER_RCD_ERROR_0 + 104)

#define TRADER_LOGIN_ERROR_CONNECT				(TRADER_RCD_ERROR_0 + 111)
#define TRADER_LOGIN_ERROR_VERSION				(TRADER_RCD_ERROR_0 + 112)

#define TRADER_RCD_NEWPWD_INVALID_NEWPWD			(TRADER_RCD_ERROR_0 + 121)

// Only for GTFIXSvr
#define TRADER_RCD_ERROR_REMOVED				(TRADER_RCD_ERROR_0 + 201)
#define TRADER_RCD_ERROR_REJECTED				(TRADER_RCD_ERROR_0 + 202)

#define TRADER_RCD_SPREAD_TIMEOUT				(TRADER_RCD_ERROR_0 + 301)
#define TRADER_RCD_SPREAD_INVALIDORDER			(TRADER_RCD_ERROR_0 + 302)
#define TRADER_RCD_ERROR_SPREAD_LEG_QUOTE		(TRADER_RCD_ERROR_0 + 303)

#define TRADER_ACCOUNT_ERROR_NO_ENOUGH_UNDERLY	(TRADER_RCD_ERROR_0 + 401)
#define	TRADER_ACCOUNT_ERROR_CALL_NOT_ALLOW_SELL	(TRADER_RCD_ERROR_0 + 402)
#define TRADER_ACCOUNT_ERROR_BUY_TO_OPEN_PENDING	(TRADER_RCD_ERROR_0 + 403)
#define TRADER_ACCOUNT_ERROR_SELL_TO_OPEN_PENDING	(TRADER_RCD_ERROR_0 + 404)
#define TRADER_ACCOUNT_ERROR_LONG_POSITION_EXIST	(TRADER_RCD_ERROR_0 + 405)
#define TRADER_ACCOUNT_ERROR_SHORT_POSITION_EXIST	(TRADER_RCD_ERROR_0 + 406)

#define TRADER_RCD_ERROR_NO_ACCOUNT_PERMISSION		(TRADER_RCD_ERROR_0 + 411)
#define TRADER_RCD_ERROR_NO_ACCOUNT_APPROVAL		(TRADER_RCD_ERROR_0 + 412)
#define TRADER_RCD_ERROR_WRONG_ACCOUNT_CODE			(TRADER_RCD_ERROR_0 + 413)
#define TRADER_RCD_ERROR_WRONG_BUREAUID				(TRADER_RCD_ERROR_0 + 414)
#define TRADER_RCD_ERROR_WRONG_RECONCILEID			(TRADER_RCD_ERROR_0 + 415)
#define TRADER_RCD_ERROR_WRONG_ACCOUNT_TYPE			(TRADER_RCD_ERROR_0 + 416)
#define TRADER_RCD_ERROR_WRONG_MARGIN_TYPE			(TRADER_RCD_ERROR_0 + 417)
#define TRADER_RCD_ERROR_WRONG_CAPACITY				(TRADER_RCD_ERROR_0 + 418)

#define TRADER_RCD_ERROR_NO_EXT_HOUR				(TRADER_RCD_ERROR_0 + 419)
#define TRADER_RCD_ERROR_WRONG_CUSTOMER_OR_FIRM		(TRADER_RCD_ERROR_0 + 420)
#define TRADER_RCD_ERROR_ONLY_LIMIT_EXT_HOUR		(TRADER_RCD_ERROR_0 + 500)

#define TRADER_RCD_ERROR_OPTION_ORDER_NO_ENTITLE			(TRADER_RCD_ERROR_0 + 501)
#define TRADER_RCD_ERROR_OPTION_ORDER_NO_POSITION_TO_CLOSE	(TRADER_RCD_ERROR_0 + 502)
#define TRADER_RCD_ERROR_WRONG_OPTION_UNDERLY	(TRADER_RCD_ERROR_0 + 503)
#define TRADER_RCD_ERROR_WRONG_OPTION_STRIKE	(TRADER_RCD_ERROR_0 + 504)
#define TRADER_RCD_ERROR_WRONG_OPTION_YEAR		(TRADER_RCD_ERROR_0 + 505)
#define TRADER_RCD_ERROR_WRONG_OPTION_PRICE		(TRADER_RCD_ERROR_0 + 506)
#define TRADER_RCD_ERROR_WRONG_OPTION_MULTIPLIER			(TRADER_RCD_ERROR_0 + 507)
#define TRADER_RCD_ERROR_WRONG_OPTION_PUTORCALL				(TRADER_RCD_ERROR_0 + 508)
#define TRADER_RCD_ERROR_WRONG_OPTION_ORDER					(TRADER_RCD_ERROR_0 + 509)

#define TRADER_RCD_ERROR_OPTION_NO_PERMISSION_BUY_OPEN					(TRADER_RCD_ERROR_0 + 520)
#define TRADER_RCD_ERROR_OPTION_NO_PERMISSION_SELL_OPEN_PUT				(TRADER_RCD_ERROR_0 + 521)
#define TRADER_RCD_ERROR_OPTION_NO_PERMISSION_SELL_OPEN_COVERED_CALL	(TRADER_RCD_ERROR_0 + 522)
#define TRADER_RCD_ERROR_OPTION_NO_PERMISSION_SELL_OPEN_NAKED_CALL		(TRADER_RCD_ERROR_0 + 523)

#ifdef __cplusplus
extern "C"
{
#endif//__cplusplus

LPCSTR GetTraderErrorMessage(int nReason);
LPCSTR GetTraderErrorReason(int nReason, LPSTR pszMsg = NULL);

#ifdef __cplusplus
}
#endif//__cplusplus

#endif//__TRADERERRMSG_H__
